package com.panshi.controller;

import com.panshi.api.ArticleApi;
import com.panshi.api.SortApi;
import com.panshi.api.UserApi;
import com.panshi.po.ArticlePo;
import com.panshi.po.SortPO;
import com.panshi.po.UserPO;
import com.panshi.vo.InformationVO;
import com.panshi.vo.PageBeanVo;
import com.panshi.vo.PageVO;
import com.panshi.vo.ResponseVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Controller
@Slf4j
public class Test {

    @Resource
    private ArticleApi articleApi;

    @Resource
    private UserApi userApi;

    @Resource
    private SortApi sortApi;


    @GetMapping("/show")
    @ResponseBody
    public ResponseVO<List<SortPO>> show(){
        PageVO pageVO = new PageVO();
        pageVO.setCurrenPage(1);
        pageVO.setSize(5);
        return sortApi.sortQuery(pageVO);
    }

        //文章详情
         @GetMapping("/detail")
         public String detail(){
             return "article/detail";
         }


        //首页
        @GetMapping("/home")
            public String home(){
            return "other/homePage";
        }

        //搜索 已解决
        @GetMapping("/search")
            public String search(){
            return "other/seacher";
        }

        //登录
        @GetMapping("/logic")
            public String logic(){
            return "logic/logic";
        }

        //注册
        @GetMapping("/register")
            public String register(){
            return "logic/register";
        }

        //问题详情
        @GetMapping("/issue")
            public String issue(){
            return "question/issue";
        }

        //问题 已解决
        @GetMapping("/qa")
            public String qa(){
            return "question/qa";
        }

        //用户协议
        @GetMapping("/agreement")
            public String agreement(){
            return "website/agreement";
        }

        //留言反馈
        @GetMapping("/leave")
            public String leave(){
            return "website/leave";
        }

        //联系我们
        @GetMapping("/link")
            public String link(){
            return "website/link";
        }

        //网站地图
        @GetMapping("/map")
            public String map(){
            return "website/map";
        }

        //关于我们
        @GetMapping("/me")
            public String me(){
            return "website/me";
        }

        //隐私声明
        @GetMapping("/privacy")
            public String privacy(){
            return "website/privacy";
        }

        //招聘信息
        @GetMapping("/recruit")
            public String recruit(){
            return "website/recruit";
        }

        //个人中心
        @GetMapping("/center")
            public String center(){
            return "user/userCenter";
        }

        //个人信息
        @GetMapping("/message")
            public String message(){
            return "user/userMessage";
        }

        //站内信息 已解决
        @GetMapping("/instation")
            public String instation(){
            return "user/instationMsg";
        }

        //个人主页 有问题
        @GetMapping("/homepage")
            public String homepage(){
            return "user/userHomepage";
        }
}
